package com.example.forum.domain;

/*
    分页对象
 */
public class Page {
    private int curPage;    //当前页码
    private int totalPage;  //总页数
    private int totalCount; //总记录数
    private int pageSize;   //每页大小

    public Page() {
        this.pageSize=10;   //默认每页大小为10
    }

    public Page(int pageSize) {
        this.pageSize = pageSize;
    }

    public int getCurPage() {
        return curPage;
    }

    public void setCurPage(int curPage) {
        this.curPage = curPage;
    }

    public int getTotalPage() {
        return totalCount%pageSize==0?totalCount/pageSize:totalCount/pageSize+1;
    }

    public void setTotalPage(int totalPage) {
        this.totalPage = totalPage;
    }

    public int getTotalCount() {
        return totalCount;
    }

    public void setTotalCount(int totalCount) {
        this.totalCount = totalCount;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }
}
